package java_test.exception;

public class ExceptionDemo1 {
    public static void main(String[] args) {
        Demo d = new Demo();
        try {
//            int x = d.div(4,0);//程序运行截图中的三组示例 分别对应此处的三行代码
//            int x = d.div(5,0);
            int x = d.div(4, 1);
        } catch (ArithmeticException e) {
            System.out.println(e.toString());
        } catch (ArrayIndexOutOfBoundsException e) {
            System.out.println(e.toString());
        } catch (Exception e) {
            System.out.println(e.toString());
        }
        System.out.println("Over");
    }
}
